<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<%
	String path = request.getContextPath() + "/";
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path;
%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<base href="<%=basePath%>">
<meta charset="UTF-8">
<title>朗读结束</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="css/d_common.css">
<script src="js/jquery-1.9.1.js"></script>
<script>
var localip = '${localip}';

var i = 120;
Timeout();
function Timeout(){
	if(i>0){
		i--;
		setTimeout(function(){Timeout();},1000);
	}else{
		window.location.href="<%=basePath%>declaimer/first?devicecode=${devicecode}&guid=${guid}";
	}
}
//切换摄像头特写或全景
getpath();
function getpath(){
	$.ajax({
		type: "get",
        dataType: 'jsonp',
        jsonp:"jsoncallback",
        timeout:5000,
		url :  'http://'+localip+'/classes/common/Reading.php?method=getLastVideoPath',// 请求的action路径
		error: function (XMLHttpRequest, textStatus, errorThrown) {
			if(XMLHttpRequest.status!=200){
				layer.confirm('视频保存失败，请点击确认重新保存！', {
					  btn: ['确定'] //按钮
				}, function(){
					getpath();
				}, function(){
				});
			}
		},
		success : function (data) {
			
		}
	});	
}
//处理录播设备返回数据
function jsoncallback(data){
	location.href="Wldt:http://"+localip+data;
	$.ajax({
		async : false,
		cache : false,
		type : 'post',
		dataType : "json",
		url :  'declaimer/readurl?guid=${guid}&devicecode=${devicecode }&url='+data,// 请求的action路径
		error : function(XMLHttpRequest, textStatus, errorThrown) {
			layer.msg("请求失败！");
		},
		success : function(data) {
		}
	});	
	//视频下载地址("http://"+localip+data);
}
</script>
</head>
<body class="bg3">
<div class="header">
    <div class="logo"><a href="declaimer/first?guid=${guid}&devicecode=${devicecode}"><img src="img/n_logo.png" alt=""></a></div>
    <%--<div class="user">
        <img src="${user.pic==null?'img/man.png':user.pic==''?'img/man.png':user.pic }" alt="">
        <div class="admin">
            <span class="name">${user.name }</span><br>
            <span class="number">${user.cardno }</span>
        </div>
    </div>
--%></div>

<div class="main">
    <div class="cont clear">
        <span><img src="img/close.png" alt=""></span>
        <div class="cont_fl fl">
        	<ul style="font-size: 20px;padding: 70px;">
        		<li>1、本次朗读已经结束！</li>
        		<li>2、如需要再次朗读，请扫描右边二维码重新登录！</li>
        		<li>3、关注信昇达微信号可查看朗读记录。</li>
        		<li>4、谢谢使用信昇达朗读亭。</li>
        	</ul>
        </div>

        <div class="login_wx fr">
            <img src="https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=${ticket }" alt="">
            <p>扫一扫，关注公众号</p>
        </div>
    </div>

</div>
</body>
</html>